package c.h.a.j0;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.DhcpInfo;
import android.net.NetworkInfo;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.p2p.WifiP2pManager;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import b.i.b.f;
import c.h.a.m0.k;
import c.h.a.n0.h.c;
import com.liuzh.deviceinfo.DeviceInfoApp;
import com.liuzh.deviceinfo.utilities.network.NetworkStateReceiver;
import com.liuzh.deviceinfo.view.kv.KvCard;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;

/* compiled from: TabNetwork */
public class v0 extends h0 implements com.liuzh.deviceinfo.utilities.network.NetworkStateReceiver.a {
    public View W;
    public ImageView X;
    public TextView Y;
    public TextView Z;
    public TextView b0;
    public KvCard c0;
    public KvCard d0;
    public BroadcastReceiver e0 = new NetworkStateReceiver(this);
    @SuppressLint({"SetTextI18n"})
    public Runnable f0 = new a();
    public PhoneStateListener g0 = new b();
    public int h0 = 0;
    public HandlerThread i0;
    public Handler j0;

    /* compiled from: TabNetwork */
    public class a implements Runnable {
        /* JADX WARNING: Removed duplicated region for block: B:16:0x0053  */
        /* JADX WARNING: Removed duplicated region for block: B:15:0x0037  */
        public void run() {
            /*
            r6 = this;
            r0 = c.h.a.j0.v0.this;
            r0 = r0.m0();
            if (r0 == 0) goto L_0x0009;
        L_0x0008:
            return;
        L_0x0009:
            r0 = c.h.a.j0.v0.this;
            r0 = r0.b0;
            if (r0 == 0) goto L_0x00b7;
        L_0x000f:
            r0 = c.h.a.m0.r.a.D();
            if (r0 == 0) goto L_0x0076;
        L_0x0015:
            r0 = com.liuzh.deviceinfo.DeviceInfoApp.c;
            r1 = "wifi";
            r0 = r0.getSystemService(r1);
            r0 = (android.net.wifi.WifiManager) r0;
            r1 = -2147483648; // 0xffffffff80000000 float:-0.0 double:NaN;
            if (r0 != 0) goto L_0x0024;
        L_0x0023:
            goto L_0x002a;
        L_0x0024:
            r0 = r0.getConnectionInfo();
            if (r0 != 0) goto L_0x002d;
        L_0x002a:
            r0 = -2147483648; // 0xffffffff80000000 float:-0.0 double:NaN;
            goto L_0x0031;
        L_0x002d:
            r0 = r0.getRssi();
        L_0x0031:
            r2 = "%";
            r3 = 100;
            if (r0 != r1) goto L_0x0053;
        L_0x0037:
            r1 = c.h.a.j0.v0.this;
            r1 = r1.b0;
            r4 = "- dBm, ";
            r4 = c.b.a.a.a.g(r4);
            r0 = android.net.wifi.WifiManager.calculateSignalLevel(r0, r3);
            r4.append(r0);
            r4.append(r2);
            r0 = r4.toString();
            r1.setText(r0);
            goto L_0x00b7;
        L_0x0053:
            r1 = c.h.a.j0.v0.this;
            r1 = r1.b0;
            r4 = new java.lang.StringBuilder;
            r4.<init>();
            r4.append(r0);
            r5 = " dBm, ";
            r4.append(r5);
            r0 = android.net.wifi.WifiManager.calculateSignalLevel(r0, r3);
            r4.append(r0);
            r4.append(r2);
            r0 = r4.toString();
            r1.setText(r0);
            goto L_0x00b7;
        L_0x0076:
            r0 = c.h.a.m0.r.a.B();
            r1 = "- dBm";
            if (r0 == 0) goto L_0x00b0;
        L_0x007e:
            r0 = android.os.Build.VERSION.SDK_INT;
            r2 = 28;
            if (r0 < r2) goto L_0x00b7;
        L_0x0084:
            r0 = c.h.a.j0.v0.this;
            r0 = r0.Z();
            r2 = "phone";
            r0 = r0.getSystemService(r2);
            r0 = (android.telephony.TelephonyManager) r0;
            if (r0 == 0) goto L_0x00a8;
        L_0x0094:
            r0 = r0.getSignalStrength();
            if (r0 == 0) goto L_0x00a0;
        L_0x009a:
            r1 = c.h.a.j0.v0.this;
            c.h.a.j0.v0.s0(r1, r0);
            goto L_0x00b7;
        L_0x00a0:
            r0 = c.h.a.j0.v0.this;
            r0 = r0.b0;
            r0.setText(r1);
            goto L_0x00b7;
        L_0x00a8:
            r0 = c.h.a.j0.v0.this;
            r0 = r0.b0;
            r0.setText(r1);
            goto L_0x00b7;
        L_0x00b0:
            r0 = c.h.a.j0.v0.this;
            r0 = r0.b0;
            r0.setText(r1);
        L_0x00b7:
            r0 = c.h.a.m0.p.a.a;
            r1 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;
            r0.postDelayed(r6, r1);
            return;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.h.a.j0.v0$a.run():void");
        }
    }

    /* compiled from: TabNetwork */
    public class b extends PhoneStateListener {
        public void onSignalStrengthsChanged(SignalStrength signalStrength) {
            v0.s0(v0.this, signalStrength);
        }
    }

    public static void s0(c.h.a.j0.v0 r7, android.telephony.SignalStrength r8) {
        /*
        java.util.Objects.requireNonNull(r7);
        r0 = android.os.Build.VERSION.SDK_INT;
        r1 = "- dBm";
        r2 = " dBm, ";
        r3 = " asu";
        r4 = 0;
        r5 = 29;
        if (r0 < r5) goto L_0x005a;
    L_0x0010:
        r8 = r8.getCellSignalStrengths();
        r8 = r8.iterator();
    L_0x0018:
        r0 = r8.hasNext();
        r5 = 2147483647; // 0x7fffffff float:NaN double:1.060997895E-314;
        if (r0 == 0) goto L_0x0032;
    L_0x0021:
        r0 = r8.next();
        r0 = (android.telephony.CellSignalStrength) r0;
        r6 = r0.getDbm();
        if (r6 == r5) goto L_0x0018;
    L_0x002d:
        r4 = r0.getAsuLevel();
        goto L_0x0035;
    L_0x0032:
        r6 = 2147483647; // 0x7fffffff float:NaN double:1.060997895E-314;
    L_0x0035:
        if (r6 != r5) goto L_0x003e;
    L_0x0037:
        r7 = r7.b0;
        r7.setText(r1);
        goto L_0x01d2;
    L_0x003e:
        r7 = r7.b0;
        r8 = new java.lang.StringBuilder;
        r8.<init>();
        r8.append(r6);
        r8.append(r2);
        r8.append(r4);
        r8.append(r3);
        r8 = r8.toString();
        r7.setText(r8);
        goto L_0x01d2;
    L_0x005a:
        r0 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r5 = "android.permission.READ_PHONE_STATE";
        r0 = c.h.a.e0.a.a(r0, r5);
        if (r0 != 0) goto L_0x0066;
    L_0x0064:
        goto L_0x01cd;
    L_0x0066:
        r0 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r1 = "phone";
        r0 = r0.getSystemService(r1);
        r0 = (android.telephony.TelephonyManager) r0;
        r1 = 1;
        if (r0 == 0) goto L_0x00ba;
    L_0x0073:
        r0 = r0.getPhoneType();
        r5 = 2;
        if (r0 != r5) goto L_0x0099;
    L_0x007a:
        r8 = r8.getCdmaDbm();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r0.append(r8);
        r0.append(r2);
        r8 = c.h.a.m0.r.a.s(r8);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x0099:
        if (r0 != r1) goto L_0x00ba;
    L_0x009b:
        r8 = r8.getGsmSignalStrength();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = c.h.a.m0.r.a.y(r8);
        r0.append(r1);
        r0.append(r2);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x00ba:
        r0 = c.h.a.m0.r.a.r();
        if (r0 == 0) goto L_0x01cb;
    L_0x00c0:
        r5 = r0.isAvailable();
        if (r5 != 0) goto L_0x00c8;
    L_0x00c6:
        goto L_0x01cb;
    L_0x00c8:
        r5 = r0.getType();
        if (r5 != r1) goto L_0x00d0;
    L_0x00ce:
        goto L_0x01cb;
    L_0x00d0:
        r1 = r0.getType();
        if (r1 != 0) goto L_0x01cb;
    L_0x00d6:
        r1 = r0.getSubtype();
        switch(r1) {
            case 1: goto L_0x0171;
            case 2: goto L_0x0171;
            case 3: goto L_0x0171;
            case 4: goto L_0x0153;
            case 5: goto L_0x0134;
            case 6: goto L_0x0134;
            case 7: goto L_0x0153;
            case 8: goto L_0x0171;
            case 9: goto L_0x0171;
            case 10: goto L_0x0171;
            case 11: goto L_0x0153;
            case 12: goto L_0x0134;
            case 13: goto L_0x0101;
            case 14: goto L_0x0171;
            case 15: goto L_0x0171;
            case 16: goto L_0x0171;
            case 17: goto L_0x0153;
            case 18: goto L_0x0101;
            case 19: goto L_0x00dd;
            case 20: goto L_0x0171;
            default: goto L_0x00dd;
        };
    L_0x00dd:
        r0 = r0.getSubtypeName();
        r1 = android.text.TextUtils.isEmpty(r0);
        if (r1 != 0) goto L_0x01cb;
    L_0x00e7:
        r1 = "TD-SCDMA";
        r1 = r0.equalsIgnoreCase(r1);
        if (r1 != 0) goto L_0x01ad;
    L_0x00ef:
        r1 = "WCDMA";
        r1 = r0.equalsIgnoreCase(r1);
        if (r1 != 0) goto L_0x01ad;
    L_0x00f7:
        r1 = "CDMA2000";
        r0 = r0.equalsIgnoreCase(r1);
        if (r0 == 0) goto L_0x018f;
    L_0x00ff:
        goto L_0x01ad;
    L_0x0101:
        r0 = r8.getClass();	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r1 = "getLteSignalStrength";
        r5 = new java.lang.Class[r4];	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0 = r0.getDeclaredMethod(r1, r5);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r1 = new java.lang.Object[r4];	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r8 = r0.invoke(r8, r1);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r8 = (java.lang.Integer) r8;	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r8 = r8.intValue();	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0 = new java.lang.StringBuilder;	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0.<init>();	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0.append(r8);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0.append(r2);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r8 = c.h.a.m0.r.a.s(r8);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0.append(r8);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r0.append(r3);	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        r1 = r0.toString();	 Catch:{ IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb, IllegalAccessException | NoSuchMethodException | InvocationTargetException -> 0x01cb }
        goto L_0x01cd;
    L_0x0134:
        r8 = r8.getEvdoDbm();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r0.append(r8);
        r0.append(r2);
        r8 = c.h.a.m0.r.a.s(r8);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x0153:
        r8 = r8.getCdmaDbm();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r0.append(r8);
        r0.append(r2);
        r8 = c.h.a.m0.r.a.s(r8);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x0171:
        r8 = r8.getGsmSignalStrength();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = c.h.a.m0.r.a.y(r8);
        r0.append(r1);
        r0.append(r2);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x018f:
        r8 = r8.getGsmSignalStrength();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r1 = c.h.a.m0.r.a.y(r8);
        r0.append(r1);
        r0.append(r2);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x01ad:
        r8 = r8.getCdmaDbm();
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r0.append(r8);
        r0.append(r2);
        r8 = c.h.a.m0.r.a.s(r8);
        r0.append(r8);
        r0.append(r3);
        r1 = r0.toString();
        goto L_0x01cd;
    L_0x01cb:
        r1 = "-";
    L_0x01cd:
        r7 = r7.b0;
        r7.setText(r1);
    L_0x01d2:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.h.a.j0.v0.s0(c.h.a.j0.v0, android.telephony.SignalStrength):void");
    }

    public void E(Bundle bundle) {
        super.E(bundle);
        if (this.i0 == null) {
            HandlerThread handlerThread = new HandlerThread("network_updater");
            this.i0 = handlerThread;
            handlerThread.start();
        }
        if (this.j0 == null) {
            this.j0 = new Handler(this.i0.getLooper());
        }
    }

    public View G(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        if (this.W == null) {
            View inflate = layoutInflater.inflate(2131493056, viewGroup, false);
            this.W = inflate;
            this.c0 = (KvCard) inflate.findViewById(2131297340);
            this.d0 = (KvCard) this.W.findViewById(2131296718);
            u uVar = new u(this);
            this.c0.setPermissionRequester(uVar);
            this.d0.setPermissionRequester(uVar);
            v vVar = new v(this);
            Handler handler = c.h.a.m0.p.a.a;
            try {
                c.h.a.m0.p.a.c.execute(vVar);
            } catch (RejectedExecutionException unused) {
            }
            this.X = (ImageView) this.W.findViewById(2131296652);
            this.Y = (TextView) this.W.findViewById(2131296757);
            this.Z = (TextView) this.W.findViewById(2131296759);
            this.b0 = (TextView) this.W.findViewById(2131296897);
            w0();
        }
        return this.W;
    }

    public void N() {
        this.E = true;
        Z().unregisterReceiver(this.e0);
        c.h.a.m0.p.a.a.removeCallbacks(this.f0);
        if (VERSION.SDK_INT < 28) {
            TelephonyManager telephonyManager = (TelephonyManager) Z().getSystemService("phone");
            if (telephonyManager != null) {
                telephonyManager.listen(this.g0, 0);
            }
        }
    }

    public void O(int i, String[] strArr, int[] iArr) {
        v0(DeviceInfoApp.c, new Intent());
    }

    public void P() {
        this.E = true;
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
        intentFilter.addAction("android.intent.action.PHONE_STATE");
        intentFilter.addAction("android.net.wifi.WIFI_STATE_CHANGED");
        intentFilter.addAction("android.net.wifi.STATE_CHANGE");
        Z().registerReceiver(this.e0, intentFilter);
        this.f0.run();
        if (VERSION.SDK_INT < 28) {
            TelephonyManager telephonyManager = (TelephonyManager) Z().getSystemService("phone");
            if (telephonyManager != null) {
                telephonyManager.listen(this.g0, 256);
            }
        }
    }

    public String r0() {
        return DeviceInfoApp.c.getString(2131690124);
    }

    public final List<c> t0() {
        DeviceInfoApp deviceInfoApp = DeviceInfoApp.c;
        ArrayList arrayList = new ArrayList();
        TelephonyManager telephonyManager = (TelephonyManager) deviceInfoApp.getSystemService("phone");
        boolean B = c.h.a.m0.r.a.B();
        arrayList.add(c.a(deviceInfoApp.getString(2131690399), deviceInfoApp.getString(B ? 2131689761 : 2131690137)));
        arrayList.add(c.a(deviceInfoApp.getString(2131690118), deviceInfoApp.getString(c.h.a.m0.r.a.C() ? 2131690424 : 2131690139)));
        String str = "android.permission.READ_PHONE_STATE";
        Object obj = 1;
        Object obj2 = f.T(deviceInfoApp, str) == 0 ? 1 : null;
        String str2 = "android.permission.ACCESS_FINE_LOCATION";
        if (f.T(deviceInfoApp, str2) != 0) {
            obj = null;
        }
        String[] strArr = new String[]{str2};
        String[] strArr2 = new String[]{str};
        if (obj2 != null) {
            arrayList.add(c.a(deviceInfoApp.getString(2131689794), telephonyManager == null ? deviceInfoApp.getString(2131690514) : k.c(telephonyManager.getPhoneType())));
        } else {
            arrayList.add(c.b(deviceInfoApp.getString(2131689794), deviceInfoApp.getString(2131689956), strArr2));
        }
        if (B) {
            Enumeration networkInterfaces;
            String hostAddress;
            String string = deviceInfoApp.getString(2131689565);
            str = null;
            if (c.h.a.m0.r.a.B()) {
                ConnectivityManager connectivityManager = (ConnectivityManager) DeviceInfoApp.c.getSystemService("connectivity");
                if (connectivityManager != null) {
                    NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
                    if (activeNetworkInfo != null) {
                        str = activeNetworkInfo.getExtraInfo();
                    }
                }
            }
            arrayList.add(c.a(string, str));
            string = deviceInfoApp.getString(2131690018);
            try {
                networkInterfaces = NetworkInterface.getNetworkInterfaces();
                if (networkInterfaces != null) {
                    loop0:
                    while (networkInterfaces.hasMoreElements()) {
                        Enumeration inetAddresses = ((NetworkInterface) networkInterfaces.nextElement()).getInetAddresses();
                        if (inetAddresses != null) {
                            while (inetAddresses.hasMoreElements()) {
                                InetAddress inetAddress = (InetAddress) inetAddresses.nextElement();
                                if ((inetAddress instanceof Inet4Address) && !inetAddress.isLoopbackAddress() && !inetAddress.isLinkLocalAddress()) {
                                    hostAddress = inetAddress.getHostAddress();
                                    break loop0;
                                }
                            }
                            continue;
                        }
                    }
                }
            } catch (SocketException unused) {
            }
            hostAddress = DeviceInfoApp.c.getString(2131690514);
            arrayList.add(c.a(string, hostAddress));
            arrayList.add(c.a(deviceInfoApp.getString(2131690019), c.h.a.m0.r.a.v()));
            string = deviceInfoApp.getString(2131690016);
            try {
                networkInterfaces = NetworkInterface.getNetworkInterfaces();
                loop2:
                while (networkInterfaces.hasMoreElements()) {
                    NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement();
                    Enumeration inetAddresses2 = networkInterface.getInetAddresses();
                    while (inetAddresses2.hasMoreElements()) {
                        InetAddress inetAddress2 = (InetAddress) inetAddresses2.nextElement();
                        if ((inetAddress2 instanceof Inet4Address) && !inetAddress2.isLoopbackAddress() && !inetAddress2.isLinkLocalAddress()) {
                            hostAddress = networkInterface.getDisplayName();
                            break loop2;
                        }
                    }
                }
            } catch (SocketException unused2) {
            }
            hostAddress = DeviceInfoApp.c.getString(2131690514);
            arrayList.add(c.a(string, hostAddress));
            if (obj != null) {
                arrayList.add(c.a(deviceInfoApp.getString(2131689741), String.valueOf(c.h.a.m0.r.a.t())));
                arrayList.add(c.a(deviceInfoApp.getString(2131690457), String.valueOf(c.h.a.m0.r.a.w())));
            } else {
                arrayList.add(c.b(deviceInfoApp.getString(2131689741), deviceInfoApp.getString(2131689956), strArr));
                arrayList.add(c.b(deviceInfoApp.getString(2131690457), deviceInfoApp.getString(2131689956), strArr));
            }
        }
        return arrayList;
    }

    public final List<c> u0() {
        DeviceInfoApp deviceInfoApp = DeviceInfoApp.c;
        ArrayList arrayList = new ArrayList();
        boolean D = c.h.a.m0.r.a.D();
        arrayList.add(c.a(deviceInfoApp.getString(2131690399), deviceInfoApp.getString(D ? 2131689761 : 2131690137)));
        int i = 1;
        if (D) {
            String string;
            String str = "android.permission.ACCESS_FINE_LOCATION";
            if ((f.T(deviceInfoApp, str) == 0 ? 1 : null) != null) {
                string = deviceInfoApp.getString(2131690243);
                DeviceInfoApp deviceInfoApp2 = DeviceInfoApp.c;
                if (f.T(deviceInfoApp2, str) != 0) {
                    str = DeviceInfoApp.c.getString(2131690076);
                } else {
                    str = deviceInfoApp2.getString(2131690514);
                    WifiManager wifiManager = (WifiManager) deviceInfoApp2.getSystemService("wifi");
                    if (wifiManager != null) {
                        WifiInfo connectionInfo = wifiManager.getConnectionInfo();
                        if (connectionInfo != null) {
                            List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks();
                            if (!(configuredNetworks == null || configuredNetworks.isEmpty())) {
                                for (WifiConfiguration wifiConfiguration : configuredNetworks) {
                                    if (TextUtils.equals(connectionInfo.getSSID(), wifiConfiguration.SSID) && connectionInfo.getNetworkId() == wifiConfiguration.networkId) {
                                        str = wifiConfiguration.allowedKeyManagement.get(1) ? "WPA_PSK" : wifiConfiguration.allowedKeyManagement.get(2) ? "WPA_EAP" : wifiConfiguration.allowedKeyManagement.get(3) ? "IEEE8021X" : wifiConfiguration.allowedKeyManagement.get(4) ? "WPA2_PSK" : wifiConfiguration.allowedKeyManagement.get(5) ? "OSEN" : wifiConfiguration.allowedKeyManagement.get(6) ? "FT_PSK" : wifiConfiguration.allowedKeyManagement.get(7) ? "FT_EAP" : (wifiConfiguration.allowedKeyManagement.get(8) || wifiConfiguration.allowedKeyManagement.get(8)) ? "SAE" : wifiConfiguration.allowedKeyManagement.get(9) ? "OWE" : wifiConfiguration.allowedKeyManagement.get(10) ? "SUITE_B_192" : wifiConfiguration.allowedKeyManagement.get(11) ? "WPA_PSK_SHA256" : wifiConfiguration.allowedKeyManagement.get(12) ? "WPA_EAP_SHA256" : (wifiConfiguration.allowedKeyManagement.get(0) || wifiConfiguration.wepKeys[0] == null) ? "NONE" : "WEP";
                                    }
                                }
                            }
                        }
                    }
                }
                arrayList.add(c.a(string, str));
                str = deviceInfoApp.getString(2131689643);
                WifiInfo z = c.h.a.m0.r.a.z();
                if (z == null) {
                    string = DeviceInfoApp.c.getString(2131690514);
                } else {
                    string = z.getBSSID();
                    if (TextUtils.equals(string, "02:00:00:00:00:00")) {
                        string = DeviceInfoApp.c.getString(2131690076);
                    } else if (TextUtils.isEmpty(string)) {
                        string = DeviceInfoApp.c.getString(2131690514);
                    }
                }
                arrayList.add(c.a(str, string));
            } else {
                String[] strArr = new String[]{str};
                arrayList.add(c.b(deviceInfoApp.getString(2131690243), deviceInfoApp.getString(2131689956), strArr));
                arrayList.add(c.b(deviceInfoApp.getString(2131689643), deviceInfoApp.getString(2131689956), strArr));
            }
            str = deviceInfoApp.getString(2131689797);
            DeviceInfoApp deviceInfoApp3 = DeviceInfoApp.c;
            DhcpInfo u = c.h.a.m0.r.a.u();
            if (u == null) {
                string = deviceInfoApp3.getString(2131690514);
            } else {
                string = c.h.a.m0.r.a.A(u.serverAddress);
            }
            arrayList.add(c.a(str, string));
            str = deviceInfoApp.getString(2131689796);
            DhcpInfo u2 = c.h.a.m0.r.a.u();
            if (u2 == null) {
                string = DeviceInfoApp.c.getString(2131690514);
            } else {
                long j = (long) (u2.leaseDuration * 1000);
                TimeUnit timeUnit = TimeUnit.MILLISECONDS;
                long toHours = timeUnit.toHours(j);
                long toMinutes = timeUnit.toMinutes(j);
                string = String.format(Locale.getDefault(), "%02d:%02d:%02d", new Object[]{Long.valueOf(toHours), Long.valueOf(toMinutes - TimeUnit.HOURS.toMinutes(toHours)), Long.valueOf(timeUnit.toSeconds(j) - TimeUnit.MINUTES.toSeconds(toMinutes))});
            }
            arrayList.add(c.a(str, string));
            DhcpInfo u3 = c.h.a.m0.r.a.u();
            if (u3 == null) {
                arrayList.add(c.a(deviceInfoApp.getString(2131689939), deviceInfoApp.getString(2131690514)));
                arrayList.add(c.a(deviceInfoApp.getString(2131690414), deviceInfoApp.getString(2131690514)));
                arrayList.add(c.a(deviceInfoApp.getString(2131689803), deviceInfoApp.getString(2131690514)));
                arrayList.add(c.a(deviceInfoApp.getString(2131689804), deviceInfoApp.getString(2131690514)));
                arrayList.add(c.a(deviceInfoApp.getString(2131690018), deviceInfoApp.getString(2131690514)));
            } else {
                arrayList.add(c.a(deviceInfoApp.getString(2131689939), c.h.a.m0.r.a.A(u3.gateway)));
                arrayList.add(c.a(deviceInfoApp.getString(2131690414), c.h.a.m0.r.a.A(u3.netmask)));
                arrayList.add(c.a(deviceInfoApp.getString(2131689803), c.h.a.m0.r.a.A(u3.dns1)));
                arrayList.add(c.a(deviceInfoApp.getString(2131689804), c.h.a.m0.r.a.A(u3.dns2)));
                arrayList.add(c.a(deviceInfoApp.getString(2131690018), c.h.a.m0.r.a.A(u3.ipAddress)));
            }
            arrayList.add(c.a(deviceInfoApp.getString(2131690019), c.h.a.m0.r.a.v()));
            String string2 = deviceInfoApp.getString(2131690016);
            try {
                Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();
                loop1:
                while (networkInterfaces.hasMoreElements()) {
                    NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement();
                    Enumeration inetAddresses = networkInterface.getInetAddresses();
                    while (inetAddresses.hasMoreElements()) {
                        InetAddress inetAddress = (InetAddress) inetAddresses.nextElement();
                        if (!inetAddress.isLoopbackAddress() && !inetAddress.isLinkLocalAddress()) {
                            str = networkInterface.getDisplayName();
                            break loop1;
                        }
                    }
                }
            } catch (SocketException unused) {
            }
            str = DeviceInfoApp.c.getString(2131690514);
            arrayList.add(c.a(string2, str));
        }
        int i2 = 2131690424;
        arrayList.add(c.a(deviceInfoApp.getString(2131690567), deviceInfoApp.getString(((WifiP2pManager) deviceInfoApp.getSystemService("wifip2p")) == null ? 2131690139 : 2131690424)));
        if (D) {
            int i3;
            String str2;
            String string3 = deviceInfoApp.getString(2131690566);
            WifiInfo z2 = c.h.a.m0.r.a.z();
            if (z2 == null) {
                i3 = 0;
            } else {
                i3 = z2.getFrequency();
            }
            if (i3 <= 4900 || i3 >= 5900) {
                i = 0;
            }
            if (i == 0) {
                i2 = 2131690139;
            }
            arrayList.add(c.a(string3, deviceInfoApp.getString(i2)));
            string3 = deviceInfoApp.getString(2131690050);
            WifiInfo z3 = c.h.a.m0.r.a.z();
            if (z3 == null) {
                str2 = "0 Mbps";
            } else {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.append(z3.getLinkSpeed());
                stringBuilder.append(" ");
                stringBuilder.append("Mbps");
                str2 = stringBuilder.toString();
            }
            arrayList.add(c.a(string3, str2));
            String string4 = deviceInfoApp.getString(2131689937);
            StringBuilder stringBuilder2 = new StringBuilder();
            z3 = c.h.a.m0.r.a.z();
            if (z3 == null) {
                i3 = 0;
            } else {
                i3 = z3.getFrequency();
            }
            stringBuilder2.append(i3);
            stringBuilder2.append(" MHz");
            arrayList.add(c.a(string4, stringBuilder2.toString()));
        }
        return arrayList;
    }

    public void v0(Context context, Intent intent) {
        if (!m0() && this.W != null) {
            w0();
            this.j0.post(new s(this, this.h0, context));
        }
    }

    @SuppressLint({"SetTextI18n"})
    public final void w0() {
        if (!m0() && this.W != null) {
            TelephonyManager telephonyManager = (TelephonyManager) Z().getSystemService("phone");
            Object obj = f.T(Z(), "android.permission.ACCESS_FINE_LOCATION") == 0 ? 1 : null;
            if (c.h.a.m0.r.a.D()) {
                this.X.setImageResource(2131231046);
                if (obj != null) {
                    CharSequence string;
                    this.Y.setClickable(false);
                    this.Y.setFocusable(false);
                    TextView textView = this.Y;
                    WifiManager wifiManager = (WifiManager) DeviceInfoApp.c.getSystemService("wifi");
                    if (wifiManager == null) {
                        string = DeviceInfoApp.c.getString(2131690514);
                    } else {
                        WifiInfo connectionInfo = wifiManager.getConnectionInfo();
                        if (connectionInfo == null) {
                            string = DeviceInfoApp.c.getString(2131690514);
                        } else {
                            string = connectionInfo.getSSID();
                            if (!TextUtils.isEmpty(string) && string.length() > 2) {
                                string = string.substring(1, string.length() - 1);
                            }
                        }
                    }
                    textView.setText(string);
                } else {
                    this.Y.setFocusable(true);
                    this.Y.setText(2131689956);
                    this.Y.setOnClickListener(new t(this));
                }
            } else if (c.h.a.m0.r.a.B()) {
                this.X.setImageResource(2131231045);
                this.Y.setClickable(false);
                this.Y.setFocusable(false);
                if (telephonyManager != null) {
                    TextView textView2 = this.Y;
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.append(telephonyManager.getNetworkOperatorName());
                    stringBuilder.append(" ");
                    stringBuilder.append(k.R(telephonyManager.getNetworkType()));
                    textView2.setText(stringBuilder.toString());
                } else {
                    this.Y.setText(2131690514);
                }
            } else {
                this.X.setImageResource(2131231079);
                this.Y.setClickable(false);
                this.Y.setFocusable(false);
                this.Y.setText(2131690514);
            }
            if (c.h.a.m0.r.a.D()) {
                this.Z.setText(2131690565);
            } else if (c.h.a.m0.r.a.B()) {
                this.Z.setText(2131690077);
            } else {
                this.Z.setText(2131690130);
            }
        }
    }
}
